package com.fzfnn.scrapbook;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import javax.imageio.ImageIO;
import javax.imageio.spi.IIORegistry;

@SpringBootApplication
@Slf4j
@MapperScan("com.fzfnn.scrapbook.mapper")
public class MainApplication {
    @PostConstruct
    public void registerImagePlugins() {
        // 注册所有 TwelveMonkeys 插件，包括 WebP
        ImageIO.scanForPlugins();
        System.out.println("✅ 已注册 ImageIO 插件（含 WebP）");
    }
    public static void main(String[] args) {
        SpringApplication.run(MainApplication.class, args);
        System.out.println("boot启动成功");
        log.info("swagger文档地址 http://localhost:3000/doc.html");
    }
    @PostConstruct
    public void printFormats() {
        System.out.println("支持的格式：");
        for (String format : ImageIO.getWriterFormatNames()) {
            System.out.println(format);
        }
    }

}
